package com.tedu;

import java.lang.management.ThreadMXBean;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Test01 {

    public static void main(String[] args) {
        List<String> arr = new ArrayList<>();
        arr.add("xcv");
        arr.add("");
        Object[] objects = arr.toArray();
        for (Object object : objects) {
            System.out.println(object);
        }


        String[] strs = new String[10];
        strs[0] = "";
        strs[1] = "sss";
        List<String> strings = Arrays.asList(strs);
        System.out.println(strings);


//        Test test1 = new Test();
//        Test test2 = new Test();
//
//        new Thread(){
//            public void run() {
//                try {
//                    test1.sayHello();
//                } catch (InterruptedException e) {}}
//        }.start();
//
//        new Thread(){
//            public void run()  {
//                try {
//                    test2.sayHello();
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//        }.start();
//
//        Callable call = new Callable() {
//            @Override
//            public Object call() throws Exception {
//                return null;
//            }
//        };
//        FutureTask futureTask = new FutureTask(call);
//        new Thread(futureTask).start();
//        try {
//            Object o = futureTask.get();
//
//
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        } catch (ExecutionException e) {
//            e.printStackTrace();
//        }
//        System.out.println("????????????");
    }
}


class Test{
    synchronized static void sayHello() throws InterruptedException {//Test.class
        System.out.println(Thread.currentThread().getName()+"正在执行静态方法syaHello");
        Thread.sleep(3000);
        System.out.println(Thread.currentThread().getName()+"执行静态方法syaHello完毕");
    }
    synchronized void getX() throws InterruptedException {//this ? tt
        System.out.println(this.getClass().getName());
        System.out.println(Thread.currentThread().getName()+"正在执行普通类方法");
        Thread.sleep(3000);
        System.out.println(Thread.currentThread().getName()+"执行普通类方法完毕");
    }
}
